<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
    <div class="game" style="display:block;">
        <img src="images/game/bg.jpg" alt="">
        <!-- <div class="mask"></div> -->
    </div>
    <script>
        var img = document.querySelector("img");

        img.ontouchmove = function(){
            // console.log(e.offsetY);
            console.log(this.clientY);
        }
            document.body.onmousedown = function(event){
                pageY = event.pageY || scroll().top + event.clientY;
                console.log(pageY);
            }

            //获取滚动距离
			function scroll(){
				return {
					"top": window.pageYoffset || document.body.scrollTop || document.documentElement.scrollTop,
					"left": window.pageXoffset || document.body.scrollLeft || document.documentElement.scrollLeft
				}
			}
    </script>
</body>
</html>